<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <style>
        *{
            margin: 0;
            padding: 0;
        }
        html{
            height: 100%;
        }

        body{
            min-height: 100%;
        }

        .overlay {
            width: 350px;
            height: 150px;
            background-color: #ffffff;
            border: 1px solid #000000;
            box-shadow: 1px 1px 5px grey;
            z-index: 10;

            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -80%);
        }

        .overlay .content, .title{
            margin-top: 6px;
        }

        .overlay .buttons{
            position: absolute;
            right: 0;
            bottom: 10px;
        }
        
        .overlay .ok, .cancel{
            display: inline-block;
            cursor: pointer;

            padding: 6px 16px;
            border: 1px solid #446d88;
            background: #58a;
            margin-right: 10px;
        }

        .overlay .ok{
            background-color: lightgreen;
        }

        .overlay .cancel{
            background-color: #e74f4d;
        }


    </style>
</head>
<body>

<span style="padding: 20px 46px; border: 1px solid #446d88; box-shadow: 1px 1px 5px grey; background-color: #4488aa; line-height: 40px; margin: 50px;" onclick="init()">
    显示浮出层
</span>
<script src="task.js"></script>
</body>
</html>